#include<iostream>
#include<unordered_map>
using namespace std;
// 设计一个链表，时间复杂度O(1)
struct ListNode {
	public: static int index = 0;
	int val;
	ListNode* next;
	ListNode(int val, ListNode* next) {
		map[val] = index;
		index++;
		this->next = next;
	}

	ListNode(int val) {
		// this->hashval = val;
		map[val] = index;
		index++;
		this->next = nullptr;
	}
}
unordered_map<int, int> map;
int main() {
	int n;
	cin >> n;
	ListNode* temp(-1, nullptr);
	ListNode* head(0,nullptr);
	for(int i=0;i<n;i++) {
		int val;
		cin >> val;
		temp = ListNode l(val);
		temp = temp->next;
		if(i == 0)  head = l;
	}

	int target;
	cin >> target;
	int target_index = head.map[target];
	int count = 0;
	temp = head + target_index*sizeof(head);
	cout<<temp->val<<endl;

	// while(temp) {
	// 	if (count != target) {
	// 		count++;
	// 		temp = temp->next;
	// 	}else{
	// 		break;
	// 	}
	// }


	
}
